<div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url()?>">首页</a><span class="crumb-step">&gt;
            	</span><span class="crumb-name">积分兑现</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="<?=site_url('extracted/show')?>" method="get">
                    <table class="search-tab">
                        <tr>
                            <th width="120">选择提现状态:</th>
                            <td>
                                <select name="s" id="">
                                    <option value="">全部</option>
                                    <option value="1" <?=!empty($_GET['s']) && $_GET['s'] == 1 ? 'selected':''?>>申请提现</option>
                                    <option value="2" <?=!empty($_GET['s']) && $_GET['s'] == 2 ? 'selected':''?>>后台受理</option>
                                    <option value="4" <?=!empty($_GET['s']) && $_GET['s'] == 4 ? 'selected':''?>>提现成功</option>
                                    <option value="3" <?=!empty($_GET['s']) && $_GET['s'] == 3 ? 'selected':''?>>提现失败</option>
                                </select>
                            </td>
                            <!-- <th width="70">关键字:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="" id="" type="text"></td> -->
                            <td><input class="btn btn-primary btn2" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
            	<?php if($_SESSION['group'] == 3):?>
                <div class="result-title">
                    <div class="result-list">
                        <a href="<?=site_url('bank/index')?>"><i class="icon-font"></i>我要积分兑现</a>
                    </div>
                </div>
                <?php endif;?>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th>ID</th>
                            <th>提取积分</th>
                            <th>卡号姓名</th>
                            <th>卡号</th>
                            <th>提取时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        <?php if(empty($list)):?>
                        	<tr>
                        		<td colspan="7">没有记录信息！</td>
                        	</tr>
                        <?php endif;?>
                        <?php foreach($list as $k => $v): ?>
                        	<tr>
	                            <td><?=$v['id']?></td>
	                            <td><?=$v['money']?></td>
	                            <td><?=$v['bank']['name']?></td>
	                            <td><?=$v['bank']['number']?></td>
	                            <td><?=date('Y-m-d H:i:s',$v['create_time'])?></td>
	                        	<?php if($v['status'] == 1):?>
	                        		<td style="color: red"><?=$v['status_name']?></td>
	                        	<?php elseif($v['status'] == 2):?>
	                        		<td style="color: #008200"><?=$v['status_name']?></td>
	                        	<?php elseif($v['status'] == 3):?>
	                        		<td style="color: red"><?=$v['status_name']?></td>
	                        	<?php else:?>
	                        		<td><?=$v['status_name']?></td>
	                        	<?php endif;?>
	                            <td>
	                            	<?php if($_SESSION['user']['status'] == 3):?>
		                            	<?php if($v['status'] == 2):?>
		                            		<a class="link-update" href="javascript:;" onclick="confirm('<?=$v['id']?>')">确认收款</a>
		                            	<?php else:?>
		                            		--------------
		                            	<?php endif;?>
		                            <?php else:?>
		                            	<a class="link-update" href="<?=site_url('users/index?uid='.$v['user_id'])?>" target="_blank">查看用户信息</a>
		                            	<?php if($v['status'] == 1):?>
		                            		<a class="link-update" href="javascript:;" onclick="handle('<?=$v['id']?>')">处理提现</a>
		                            	<?php else:?>

		                            	<?php endif;?>
		                            <?php endif;?>
	                            </td>
	                        </tr>
                        <?php endforeach;?>
                    </table>
                    <div class="list-page"> <?=$page?></div>
                </div>
            </form>
        </div>
        <script>
        	function confirm(eid){
        		$.post("<?=site_url('extracted/confirm')?>",{eid:eid},function(data){
        			if(data == 1){
	                    layer.alert("确认成功！感谢您的支持！",{
	                        icon:1,
	                    },function(){
	                        location.reload();
	                    });
	                }else{
	                    layer.alert(data,{
	                        icon:2,
	                    });
	                }
        		});
        	}

        	function handle(eid){
        		layer.confirm('确认之后不能取消，是否确定？', {
		            btn: ['确定','取消'] //按钮
		        }, function(){
		            $.post("<?=site_url('extracted/handle')?>",{eid:eid},function(data){
		            	if(data == 1){
		                    layer.alert("操作成功！请及时处理！",{
		                        icon:1,
		                    },function(){
		                        location.reload();
		                    });
		                }else{
		                    layer.alert(data,{
		                        icon:2,
		                    });
		                }
		            });
		        });
        	}
        </script>